#!/bin/bash

convert_file()
{
    for file in `find .`
    do
        if [[ -f $file ]]
        then
            if [[ ${file##*.} == lua || ${file##*.} == ini ]]; then
                cp $file $file".bak"
                iconv -f GB2312 -t UTF-8 $file > $file
                echo $file
            fi
        fi
    done
}

convert_file
